<!--//<=============================Bean developpé par MOUMMID HAMZA >======================//-->
{extends file="skulton.tpl"}{/extends}
{block name="monblock"}


<script src="scripts/js/Form.js"></script>
<script>

$(function() {

		$( "#dialog-form" ).dialog({
			autoOpen: false,
			height: 400,
			width: 500,
			modal: true,
			buttons: {
			},
			close: function() {
				allFields.val( "" ).removeClass( "ui-state-error" );
			}
		});

		$( ".modifier_materiel" )
			.button()
			.click(function() {
				$( "#dialog-form" ).dialog( "open" );
			});

					$( "#form_ajouter" ).dialog({
			autoOpen: false,
			height: 400,
			width: 500,
			modal: true,
			buttons: {
			},
			close: function() {
				allFields.val( "" ).removeClass( "ui-state-error" );
			}
		});

			$( "#Ajouter" )
			.button()
			.click(function() {
				$( "#form_ajouter" ).dialog( "open" );
			});
	});

</script>

<script type="text/javascript" charset="utf-8">
	var asInitVals = new Array();

	$(document).ready(function() {


	// Dialogue
	$('.modifier_materiel').click(function(){
			var a= $('.id',this);
			var id= $(a[0]).text();
			$("#id").val(id);

			a= $('.nom',this);
			var Nom= $(a[0]).text();
			$("#nom").val(Nom);

			a= $('.type',this);
			var type= $(a[0]).text();
			$("#type").val(type);

			a= $('.description',this);
			var description= $(a[0]).text();
			$("#description").val(description);







		});


     // Fin dialogue

		  $(".yesno").click(function(){
				var a = $(this);
				$( "#dialog-confirm" ).dialog({
						resizable: false,
						modal: true,
						buttons: {
							"Oui": function() {

								document.location.href="materiel.php?id_sup="+a.attr('id');
							},
							"Non": function() {
								$( this ).dialog( "close" );
							}
						}
				});
			});





		var oTable = $('#idtable').dataTable( {
			"sPaginationType": "full_numbers",
			"oLanguage": {
				"sSearch": "Rechercher:"
			}
		} );


		//recherche spécifique à la colone
		$("tfoot input").keyup( function () {
			/* Filter on the column (the index) of this element */
			oTable.fnFilter( this.value, $("tfoot input").index(this) );
		} );



		/*
		 * Support functions to provide a little bit of 'user friendlyness' to the textboxes in
		 * the footer
		 */
		$("tfoot input").each( function (i) {
			asInitVals[i] = this.value;
		} );

		$("tfoot input").focus( function () {
			if ( this.className == "search_init" )
			{
				this.className = "";
				this.value = "";
			}
		} );

		$("tfoot input").blur( function (i) {
			if ( this.value == "" )
			{
				this.className = "search_init";
				this.value = asInitVals[$("tfoot input").index(this)];
			}
		} );



			// FORMULAIRE UI





	} );
</script>




    <div class="content-box"><!-- Start Content Box -->
	    <div class="content-box-header">
		  <h3>Liste des interventions</h3>
		  <!--partie traiter par MEZOUARI KHALID-->
		  <a href="genererPDF.php?&page=intervention"  style='margin-left:10px;'><img src="images/icons/PDF.png" ></a>
    <a href="genererXSL.php?&page=intervention"  style='margin-left:10px;'><img src="images/icons/excel.png" ></a>
    <!--Fin partie réalisée par MEZOUARI KHALID-->
		   <div class="clear"></div>

     	</div> <!-- End .content-box-:>header -->
	    <div class="content-box-content">
		</div> <!-- End #messages -->
		<div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
		 {if isset($message)}
			<div class="notification success png_bg">
				<a href="#" class="close"><img src="images/icons/cross_grey_small.png" title="Close this notification" alt="close"></a>
				<div>
					{$message}
				</div>
			</div>
		 {/if}
	<div style="display:none;" id="dialog-confirm" title="Demande de confirmation">
		<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Voulez-vous vraiment supprimer cet enregistrement ?</p>
	</div>

			<table id="idtable">

        			   <thead>
        					<tr>
        					   <th><input class="check-all" type="checkbox" /></th>
        					   <th>objectif</th>
        					   <th>designation</th>
        					   <th>datedebut</th>
        					   <th>demande par</th>
        					   <th>Cible</th>
        					   <th>Date debut</th>
        					</tr>

        				</thead>


        				<tbody>
        				  {foreach $listinterv as $line}
        					<tr>
        						<td><input type="checkbox" /></td>
        						<td>{$line->getObjectif()}</td>
        						<td>{$line->getDesignation()}</td>
        						<td>{$line->getDateDebut()}</td>
        						<td> {$nomadedao->loadNomade($line->getIdNomade())->getNom()} {$nomadedao->loadNomade($line->getIdNomade())->getPrenom()}</td>
                                <td> {$nomadedao->loadNomade($line->getIdNomadeCible())->getNom()} {$nomadedao->loadNomade($line->getIdNomadeCible())->getPrenom()}</td>
                                <td>{$line->getDateDebut()}</td>
        					</tr>

        					{/foreach}

        				</tbody>
				        <tfoot>
        					<tr>
        						<th><input type="text" name="search_id" value="" class="search_int" style="display:none" /></th>
        						<th><input type="text" name="search_id" value="" class="search_int" style="display:none" /></th>
        						<th><input type="text" name="search_Nom" value="" class="search_int" /></th>
        						<th><input type="text" name="search_type" value="" class="search_int"  /></th>
        						<th><input type="text" name="search_description" value="" class="search_int"  /></th>
        						<th

        					</tr>
			      	   </tfoot>
			       </table>
                 </div>
             </div> <!-- End #tab2 -->
	       </div> <!-- End .content-box-content -->
  {/block}